package com.zshan.clinic.cms.controller.config;


import com.zshan.clinic.admin.service.config.ClinicDictService;
import com.zshan.clinic.cms.common.core.controller.BaseController;
import com.zshan.clinic.common.entity.InitMetaDataVo;
import com.zshan.clinic.common.response.RestResp;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/config/enums")
@Slf4j
public class EnumController extends BaseController {

    @Autowired
    private ClinicDictService clinicDictService;

    /**
     * 查询系统枚举
     * @return
     */
    @GetMapping(value = "/getMap")
    public RestResp<InitMetaDataVo> getMap() {
        InitMetaDataVo initMetaDataVo = new InitMetaDataVo();
        //枚举
        initMetaDataVo.setEnums(clinicDictService.getAllEnums());
        //字典
        initMetaDataVo.setDicts(clinicDictService.getAllDicts());
        return RestResp.SUCCESS(initMetaDataVo);
    }
}
